//
//  LoginDataMng.h
//  habit
//  对于登录用户的管理
//  Created by huck on 15-9-2.
//  Copyright (c) 2015年 custom. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "Macro.h"

/********************当前用户对象*********************/
@interface LoginDataItem : NSObject

@property(nonatomic,copy) NSString *userName;       //登录用的用户名
@property(nonatomic,copy) NSString *password;
@property(nonatomic,copy) NSString *userId;         //id
@property(nonatomic,copy) NSString *name;           //姓名
@property(nonatomic,strong) NSArray *roleList;      //角色列表 RoleInfoData
@property(nonatomic,copy) NSString *mobile;         //手机号
@property(nonatomic,copy) NSString *phone;          //电话号
@property(nonatomic,copy) NSString *email;          //姓名
@property(nonatomic,copy) NSString *beregion;       //管辖区域
@property(nonatomic,copy) NSString *beregionCode;       //管辖区域代码

//设置值:密码不设置
- (void)setInfo:(NSDictionary *)dict;

//督导和无水办
-(BOOL)canSuperView;

@end

/********************角色信息*********************/
@interface RoleInfoData : NSObject
@property(nonatomic,copy) NSString *roleCode;     //角色代码
@property(nonatomic,copy) NSString *roleName;     //角色名称

- (void)setInfo:(NSDictionary *)dic;

@end



/********************对登录象的管理类*********************/
@interface LoginDataMng : NSObject

@property (nonatomic, copy) NSString *jumpPayNo;

@property (nonatomic, strong)LoginDataItem *resetPwdUser;//找回密码的用户


+ (instancetype)sharedInstance;
//
- (void)clearUserInfo;

/**
 * 获取用户中心存的的登录信息,只有用户名和密码
 */
- (LoginDataItem *)getLoginUser;

- (void)saveLoginUser:(NSMutableDictionary *)result;


/**
 *  推送的设备id
 */
- (NSString *)getPushDeviceId;

/**
 * 登录
 */
- (void)login:(NSString *)username password:(NSString *)password isReload:(BOOL)isReload complete:(void (^)(BOOL success))complete;

/**
 * 暗地里重新登录
 */
- (void)reLogin:(void (^)(BOOL success))complete;

/**
 * 绑定云旺云推
 */
- (void)bindPushInfo;
- (void)unBindPushInfo:(NSString*)account callback:(void(^)())success;

//退出登录
-(void)loginOut;

//退出登录,不通知服务器
-(void)loginOutWithoutRequest;


@end
